package com.zlc.workflow.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 工作流节点类型
 *
 * @author zhanglei
 */
@Getter
@AllArgsConstructor
public enum NodeType {

    /**
     * 节点类型
     */
    START("start","开始","40*40","GREEN","flow-circle"),
    END("end","结束","40*40","RED","flow-circle"),
    TASK("task","任务","100*50","BLUE","flow-rect"),
    DISC("disc","条件","60*60","rgb(19, 194, 194)","flow-rhombus"),
    FORK("fork","分支","45*45","#FF8A00","flow-rect"),
    JOIN("join","聚合","45*45","#FF8A00","flow-rect"),
    AUTO("auto","自动处理","","",""),
    WAIT("wait","等待","","",""),
    PATH("path","路线","","",""),
    PROCESS("process","流程","","","");

    private String value;
    private String desc;
    private String size;
    private String color;
    private String shape;

    public String value(){
        return this.value;
    }

    public static NodeType  getNodeType(String type){
        NodeType[] types = values();
        for(NodeType nodeType : types){
            if(nodeType.value.equals(type)){
                return nodeType;
            }
        }
        return null;
    }


}
